Skip to content

fix(integrations): show error instead of infinite spinner on sentry app external install page#112432

Open
sentry-junior[bot] wants to merge 6 commits intomasterfrom
fix/sentry-app-external-install-error-state
Open

fix(integrations): show error instead of infinite spinner on sentry app external install page#112432
sentry-junior[bot] wants to merge 6 commits intomasterfrom
fix/sentry-app-external-install-error-state

Conversation

@sentry-junior
Copy link
Copy Markdown
Contributor

@sentry-junior sentry-junior bot commented Apr 7, 2026

Problem

When visiting the external install page for an unpublished sentry app where the user is not in the owner org, the API returns a 403:

"User must be in the app owner's organization for unpublished apps"

useApiQuery correctly marks the request as errored but the existing guard:

if (sentryAppLoading || orgsLoading || !sentryApp) {
  return <LoadingIndicator />;
}

hits !sentryApp === true and renders a <LoadingIndicator /> forever with no feedback to the user. Same issue applies to any other non-2xx response (404, 500, etc.).

Fix

  • Destructure isError from useApiQuery for the sentry app fetch
  • Track orgsError state for the orgs fetch (was silently swallowed before)
  • Split the loading guard: only show <LoadingIndicator /> while pending; render <LoadingError /> for each error case
  • Follows the existing pattern in sentryAppDetailedView.tsx

Test

Added a test case covering the 403 scenario.

…pp external install page

When the /sentry-apps/:slug/ API returns a non-2xx response (e.g. 403 for
unpublished apps where the user is not in the owner org), useApiQuery sets
sentryAppLoading=false but sentryApp=undefined. The existing guard:

  if (sentryAppLoading || orgsLoading || !sentryApp)

falls through to !sentryApp=true and renders <LoadingIndicator /> forever
with no feedback to the user.

Fix: destructure isError from useApiQuery and track orgsError state,
then render <LoadingError> with a descriptive message for each error case —
following the pattern in sentryAppDetailedView.tsx.

Also adds a test covering the 403 case.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 7, 2026
@dcramer dcramer marked this pull request as ready for review April 8, 2026 00:34
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4723c2b. Configure here.

@dcramer dcramer requested a review from TkDodo April 8, 2026 15:18
dcramer and others added 3 commits April 8, 2026 08:37
…mmediately

Deterministic errors like 403 should not be retried. Without retry: false,
React Query retries 3 times with exponential backoff, showing a spinner
for ~7+ seconds before displaying the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant